package br.com.moxirpt.model.vo.coletapk;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import br.com.moxirpt.form.FormUtil;
import br.com.moxirpt.model.log.Form;
import br.com.moxirpt.model.vo.Resumo;

@SuppressWarnings("serial")
@Entity
@Table(name = "data.vw_coleta_pk_resumo")
@NamedQueries({
	@NamedQuery(name = "ColetaPkResumoVO.obterResumos", query = "from ColetaPkResumoVO where pid = :pid"),
	@NamedQuery(name="ColetaPkResumoVO.obterItensAuditadosPorPid", query="from ColetaPkResumoVO where pid = :pid"),
	@NamedQuery(name="ColetaPkResumoVO.obterItensAuditadosPorNumScreening", query="from ColetaPkResumoVO where numScreening = :numScreening"),
	
	@NamedQuery(name = "ColetaPkResumoVO.obterResumosPorSite", query = "from ColetaPkResumoVO where site = :site"),
	@NamedQuery(name="ColetaPkResumoVO.obterItensAuditadosPorPidPorSite", query="from ColetaPkResumoVO where pid = :pid and site = :site"),
	@NamedQuery(name="ColetaPkResumoVO.obterItensAuditadosPorNumScreeningPorSite", query="from ColetaPkResumoVO where numScreening = :numScreening and site = :site")
})
public class ColetaPkResumoVO implements Serializable, Resumo {
	
	@Id
	@Column(name = "idcoleta_pk", nullable = false)
	private int idcoletaPk;
	
	@Column(name = "idinclusao", nullable = false)
	private int idInclusao;
	
	@Column(name = "pid", nullable = false)
	private int pid;
	
	@Column(name = "site", nullable = false)		
	private int site;
	
	@Column(name = "numscreening", nullable = false)
	private String numScreening;
	
	@Transient
	private Integer indice = null;
	
	@Column(name = "dtinclusao", nullable = false)
	@Temporal(TemporalType.DATE)
	private Date dtInclusao;
	
	@Transient
	private String identificacao = null;

	public int getIdcoletaPk() {
		return idcoletaPk;
	}

	public void setIdcoletaPk(int idcoletaPk) {
		this.idcoletaPk = idcoletaPk;
	}

	public int getIdInclusao() {
		return idInclusao;
	}

	public void setIdInclusao(int idInclusao) {
		this.idInclusao = idInclusao;
	}

	public int getPid() {
		return pid;
	}

	
	public void setPid(int pid) {
		this.pid = pid;
	}

	public Integer getIndice() {
		return indice;
	}

	public void setIndice(Integer indice) {
		this.indice = indice;
	}

	public Date getDtInclusao() {
		return dtInclusao;
	}

	public void setDtInclusao(Date dtInclusao) {
		this.dtInclusao = dtInclusao;
	}

	public String getIdentificacao() {
		return identificacao;
	}

	public void setIdentificacao(String identificacao) {
		this.identificacao = identificacao;
	}
	
	@Override
	public int getId(){
		return this.getIdcoletaPk();
	}

	public String getNumScreening() {
		return numScreening;
	}

	public void setNumScreening(String numScreening) {
		this.numScreening = numScreening;
	}
	
	public Integer getSite() {
		return site;
	}

	public void setSite(Integer site) {
		this.site = site;
	}
	
	
	@Override
	public Form getForm(){
		return FormUtil.FormsEnum.COLETA_PK.getForm();
	}
	

}
